<template>
	<!-- 延期原因回复 -->
  <view class="flex-col page">
	  <view class="back-w" style="">
	  	<view class="u-m-l-10" @click="Back()">
	  		<u-icon name="arrow-left" color="#000000" size="20"></u-icon>
	  	</view>
	  	<view class="f-w-l">
	  		延期原因回复</view>
	  </view>
    <view class="flex-col group_1">
      <view class="flex-col items-start text-wrapper">
				<textarea maxlength='9999'  class="textIpt" placeholder="请输入回复内容…" style="" v-model="value"></textarea>
			</view>
      <view class="flex-col items-center text-wrapper_1" @click="returnTo()"><text class="text_2">确认</text></view>
    </view>
  </view>
</template>

<script>
  export default {
    components: {},
    data() {
      return {
		  constructionPlanId:'',
		  value:''
	  };
    },
	onLoad(option) {
		this.constructionPlanId = option.id
	},
    methods: {  
		Back() {
			let pageNum = 2
			let pages = getCurrentPages(); // 当前页面
			let beforePage = pages[pages.length - pageNum];
			uni.navigateBack({
				success: function() {
						beforePage.$vm.$refs.delay.delayBe();
				}
		
			})
		},
		returnTo(){
			if(this.value ==''){
				uni.showToast({
					icon:"error",
					title:'请输入回复内容'
				})
				return
			}
			this.$http('harryroom.foremanreply',{
				temporaryConstructionId:this.constructionPlanId,
				foremanReply:this.value
			}).then(res=>{
				if(res.code==200){
					uni.showToast({
						icon: 'none',
						title:'提交成功'
					})
					uni.navigateBack({
						delta:1
					})
				}else{
					uni.showToast({
						icon:"error",
						title:res.msg
					})
				}
			})
		},
		},
  };
</script>

<style scoped lang="css">
	.textIpt{
		font-size: 28rpx;
		width: 94%;
		height: 800rpx;
		padding: 20rpx;
	}
  .page {
    background-color: #ffffffff;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
  }
  .group {
    padding: 53rpx 31.5rpx 32rpx;
    border-bottom: solid 1rpx #eeeeee;
    position: relative;
  }
  .group_1 {
    padding: 30rpx 31rpx 48rpx;
  }
  .image {
    position: absolute;
    left: 31.5rpx;
    bottom: 27.5rpx;
    width: 21rpx;
    height: 36rpx;
  }
  .text {
    color: #000000;
    font-size: 36rpx;
    font-family: '.AppleSystemUIFont';
    line-height: 43rpx;
  }
  .text-wrapper {
    padding: 31rpx 0;
    border-radius: 16rpx;
   
  }
  .text-wrapper_1 {
    padding: 19rpx 0 31rpx;
    background-color: #1d6aff;
    border-radius: 44rpx;
		position: fixed;
		bottom: 5%;
		left: 10%;
		width: 80%;
  }
  .text_1 {
    margin-left: 25rpx;
    color: #999999;
    font-size: 28rpx;
    font-family: '.AppleSystemUIFont';
    line-height: 33rpx;
  }
  .text_2 {
    color: #ffffff;
    font-size: 32rpx;
    font-family: '.AppleSystemUIFont';
    line-height: 38rpx;
  }
</style>